/*
 * Author: Alvin
 * Modified By: Alvin
 * Created Date: 2024-05-10 10:00:01
 * Last Modified: 2024-05-10 10:07:10
 * Description:
 */

enum FormItemType {
  textInput(value: 0),
  swich(value: 1),
  selectInput(value: 2),
  time(value: 3),
  date(value: 4),
  dateTime(value: 5),
  imageUpload(value: 6),
  textArea(value: 7),
  address(value: 8);

  final int value;

  const FormItemType({required this.value});

  factory FormItemType.fromType(int type) {
    switch (type) {
      case 0:
        return FormItemType.textInput;
      case 1:
        return FormItemType.swich;
      case 2:
        return FormItemType.selectInput;
      case 3:
        return FormItemType.time;
      case 4:
        return FormItemType.date;
      case 5:
        return FormItemType.dateTime;
      case 6:
        return FormItemType.imageUpload;
      case 7:
        return FormItemType.textArea;
      case 8:
        return FormItemType.address;
      default:
        return FormItemType.textInput;
    }
  }
}
